cmake_minimum_required(VERSION 3.5)
project(fake_laser)
add_compile_options(-std=c++17)

# Find packages
find_package(PCL REQUIRED COMPONENTS common)
find_package(Eigen3 REQUIRED)
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(grid_map_core REQUIRED)
find_package(grid_map_ros REQUIRED)
find_package(grid_map_cv REQUIRED)
find_package(agv_msgs REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(pcl_conversions REQUIRED)
find_package(tf2_eigen REQUIRED)
find_package(nav_msgs REQUIRED)
find_package(tf2_geometry_msgs REQUIRED)
find_package(tf2_ros REQUIRED)

set(CMAKE_BUILD_TYPE Release)

include_directories(
  include
  ${PCL_INCLUDE_DIRS}
)

add_executable(fake_laser_node 
  src/fake_laser/fake_laser_node.cpp
  src/fake_laser/FakeLaser.cpp
  src/fake_laser/LaserGenerator.cpp
  src/occupancyMap/OccupancyGridMap.cpp
  src/occupancyMap/OccupancyGridMapHelper.cpp
  src/occupancyMap/OccupancyGridMapRosConverter.cpp 
)

target_link_libraries(fake_laser_node ${PCL_LIBRARIES})

ament_target_dependencies(fake_laser_node
  rclcpp
  sensor_msgs
  agv_msgs
  grid_map_core
  pcl_conversions
  tf2_eigen
  grid_map_ros
  nav_msgs
  grid_map_cv
  tf2_geometry_msgs
  tf2_ros
)

install(TARGETS
  fake_laser_node
  DESTINATION lib/${PROJECT_NAME}
)

install(DIRECTORY
  launch
  config
  DESTINATION share/${PROJECT_NAME}
)

ament_export_include_directories(include)
ament_export_libraries()
ament_export_dependencies(rclcpp grid_map_core grid_map_ros grid_map_cv agv_msgs)
ament_package()